home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / cleanerram / cleanram.dopus < prev    next >
Text File  |  1996-04-24  |  1KB  |  44 lines

  1. /*
  2.   $VER: cleanram.dopus 2.0
  3. */
  4.  
  5. options results      /* need results */
  6.  
  7. /* this library is needed for statef function */
  8.  
  9. if ~show('l','rexxsupport.library') then    /* check if lib is loaded */
  10.    call addlib('rexxsupport.library',0,-30) /* if not, load it */
  11.  
  12. /* call to the Wb delete command */
  13. address command 'delete ram:~(ENV|T|Clipboards|Disk.info) ALL'
  14.  
  15. status 3
  16. win=result            /* get active dopus window */
  17.  
  18. status 13 win
  19. currentdir=result     /* get this window directory */
  20. basedir = upper(left(currentdir,3))  /* Ram disk: or RAM:   -> RAM */
  21.  
  22. if basedir = 'RAM' then                  /* if we are somewhere in ram: */
  23. do
  24.   existdir = left(statef(currentdir),3)  /* check if the dir still exists */
  25.   if existdir ~= 'DIR' then              /* if we can't find it no more */
  26.     scandir 'RAM:'                       /* we go back in RAM: */
  27.   else
  28.     rescan                               /* reread the current dir */
  29. end
  30.  
  31. status 13 1-win                        /* get the other window */
  32. currentdir=result
  33. basedir = upper(left(currentdir,3))    /* Ram dir/RAM   -> RAM */
  34. if basedir = 'RAM' then
  35. do
  36.   otherwindow                          /* make the other window active */
  37.   existdir = left(statef(currentdir),3)
  38.   if existdir ~= 'DIR' then
  39.      scandir 'RAM:'
  40.   else
  41.      rescan
  42.   otherwindow                          /* we go back in our window */
  43. end
  44.